<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 100px;
        height: 100px;
        background-color: #f00;
      }
      .active {
        width: 500px;
        height: 500px;
      }
    </style>
  </head>
  <body>
    <!-- v-bind用于class
    1:  :class="{class类名:boolean}"            主流
    2:  :class="'class类名'"                    了解
    3:  :class="['class类名','class类名2']"     了解
    -->
    <div id="app">
      <button @click="bol=!bol">点击修改box尺寸</button>
      <div class="box" :class="{active:bol}"></div>
      <button @click="str='active'">点击修改box尺寸</button>
      <div class="box" :class="str"></div>
      <button @click="arr.push('active')">点击修改box尺寸</button>
      <div class="box" :class="arr"></div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data: {
          bol: true,
          str: '',
          arr: []
        }
      })
    </script>
  </body>
</html>
